package com.pearadmin.pro.modules.project.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;

import com.pearadmin.pro.modules.project.domain.ProjectCharge;
import com.pearadmin.pro.modules.project.dto.ProjectChargeDTO;
import com.pearadmin.pro.modules.project.param.ProjectChargeRequest;
import com.pearadmin.pro.modules.project.repository.ProjectChargeRepository;
import com.pearadmin.pro.modules.project.service.ProjectChargeService;
import com.pearadmin.pro.modules.school.domain.CourseBasicInformation;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;

/**
 * 项目人员关系Service业务层处理
 *
 * @author ChenJian
 * @date 2021-08-29
 */
@Service
public class ProjectChargeServiceImpl extends ServiceImpl<ProjectChargeRepository, ProjectCharge> implements ProjectChargeService
{
    @Resource
    private ProjectChargeRepository projectChargeRepository;

    /**
     * 查询项目人员关系
     * @param request
     * @return 项目人员关系 分页集合
     * */
    @Override
    public PageResponse<ProjectCharge> page(ProjectChargeRequest request)
    {
        LambdaQueryWrapper<ProjectCharge> query = new LambdaQueryWrapper<ProjectCharge>();
        return Pageable.of(request,(()->  projectChargeRepository.selectList(query)));
    }

    /**
     * 查询项目人员关系
     *
     * @param id 项目人员关系ID
     * @return 项目人员关系
     */
    @Override
    public List<ProjectChargeDTO> selectProjectChargeId(Long id)
    {
        return projectChargeRepository.selectProjectChargeId(id);
    }

}
